// write_file_sync.js
const fs = require('fs');
const content = '这是同步写入的内容';
try {
    fs.writeFileSync('new_file_sync.txt', content);
    console.log('文件同步写入成功');
} catch (err) {
    console.error('写入文件出错:', err);
}
